package com.ruoyi.applet.service.impl;

import java.math.BigDecimal;
import java.util.List;

import com.ruoyi.applet.domain.OrderStatus;
import com.ruoyi.applet.domain.vo.OrderByUserId;
import org.springframework.stereotype.Service;
import com.ruoyi.applet.mapper.OrderMapper;
import com.ruoyi.applet.domain.Order;
import com.ruoyi.applet.service.IOrderService;

import javax.annotation.Resource;

/**
 * 订单列表Service业务层处理
 *
 * @author ruoyi
 * @date 2024-12-13
 */
@Service
public class OrderServiceImpl implements IOrderService
{
    @Resource
    private OrderMapper orderMapper;


    @Override
    public List<Order> selectOrderUerIdOrderList(Long usrId) {
        return orderMapper.selectOrderUerIdOrderList(usrId);
    }

    @Override
    public OrderByUserId selectOrderUerIdList(Long usrId, Long productSpecValueId) {
        return orderMapper.selectOrderUerIdList(usrId, productSpecValueId);
    }

    @Override
    public List<OrderByUserId> selectOrderProductSpecValueIdList(Long usrId, Long orderStatus) {
        return orderMapper.selectOrderProductSpecValueIdList(usrId, orderStatus);
    }

    @Override
    public List<OrderStatus> selectAllByOrderIdStatusList() {
        return orderMapper.selectAllByOrderIdStatusList();
    }

    @Override
    public OrderByUserId selectByOrderStatusInteger(Long usrId, Long orderStatus) {
        return orderMapper.selectByOrderStatusInteger(usrId, orderStatus);
    }

    @Override
    public List<OrderByUserId> selectByOrderStatusList(Long usrId) {
        return orderMapper.selectByOrderStatusList(usrId);
    }

    @Override
    public Integer updateByOrderIdInteger(Long usrId, String orderId) {
        return orderMapper.updateByOrderIdInteger(usrId, orderId);
    }

    @Override
    public Integer updateOrderIdAndOrderUerIdInteger(Long usrId, Long status, String orderId) {
        return orderMapper.updateOrderIdAndOrderUerIdInteger(usrId, status, orderId);
    }

    @Override
    public OrderByUserId selectAllByOrderIdAndOrderUerIdOrderByUserId(Long usrId, String orderId) {
        return orderMapper.selectAllByOrderIdAndOrderUerIdOrderByUserId(usrId, orderId);
    }

    @Override
    public Integer insertAllInteger(Long usrId,String orderId, String orderTotal, String orderReceiverName, String orderReceiverPhone, String orderReceiverAddress, Long orderGoodsId, Long orderNumber, String orderTransactionId) {
        return orderMapper.insertAllInteger(usrId,orderId, orderTotal, orderReceiverName, orderReceiverPhone, orderReceiverAddress, orderGoodsId, orderNumber,orderTransactionId);
    }

    @Override
    public Order selectAllByOrderGoodsIdCount(Long usrId, Long orderGoodsId) {
        return orderMapper.selectAllByOrderGoodsIdCount(usrId, orderGoodsId);
    }

    @Override
    public Integer updateOrderGoodsIdAndOrderUerIdInteger(Long usrId, String orderId, Long orderNumber) {
        return orderMapper.updateOrderGoodsIdAndOrderUerIdInteger(usrId, orderId, orderNumber);
    }

    @Override
    public Integer deleteByOrderIdInteger(Long usrId, String orderId) {
        return orderMapper.deleteByOrderIdInteger(usrId, orderId);
    }

    @Override
    public Order selectOrderUerIdOrder(String orderId) {
        return orderMapper.selectOrderUerIdOrder(orderId);
    }

    @Override
    public Integer updateAllByOrderIdInteger(Long orderStatus, String orderId) {
        return orderMapper.updateAllByOrderIdInteger(orderStatus, orderId);
    }

    @Override
    public Integer updateOrderIdAndOrderUerId(String orderId, Long usrId, BigDecimal price) {
        return orderMapper.updateOrderIdAndOrderUerId(orderId, usrId, price);
    }

    @Override
    public Order selectOrderNotesAndOrderUerId(Long usrId, Long spikesGoodId) {
        return orderMapper.selectOrderNotesAndOrderUerId(usrId,spikesGoodId);
    }

    @Override
    public Order selectOrderNotesOrder(String orderId) {
        return orderMapper.selectOrderNotesOrder(orderId);
    }
}
